package com.wise.service.cms.content.industryinformationcolumn;


import cn.hutool.core.bean.BeanUtil;
import com.wise.entities.content.ArticleColumn;
import com.wise.entities.content.IndustryInformationColumn;
import com.wise.framework.basic.DateTimeUtil;
import com.wise.framework.daomodel.DaoOne4Update;
import com.wise.framework.daomodel.DaoSave;
import com.wise.framework.session.CurrentUserId;
import com.wise.summer.v1.cms.content.column.UpdateColumnById;
import com.wise.summer.v1.cms.content.industryinformationcolumn.UpdateIndustryInformationColumnById;
import org.springframework.stereotype.Service;
import org.summerframework.model.SummerService;
import org.summerframework.model.SummerServiceBean;

import static com.wise.model.content.ContentErrMsgs.Err_001600250014;

@Service
@SummerService
public class UpdateIndustryInformationColumnService implements SummerServiceBean<UpdateIndustryInformationColumnById> {
    @Override
    public void sum(UpdateIndustryInformationColumnById model) {
        IndustryInformationColumn articleColumn = DaoOne4Update.s(IndustryInformationColumn.class, model.getId(), Err_001600250014);
        BeanUtil.copyProperties(model, articleColumn);
        articleColumn.setLastUpdateBy(CurrentUserId.s(true));
        articleColumn.setLastUpdateDate(DateTimeUtil.timestampNow());
        DaoSave.s(articleColumn);
        model.setSummerResult(articleColumn);
    }
}
